Material Stock Selection

Some process groups use material stock. The material that is used by such process groups has some form or structure even before the manufacturing process begins. For the sheet metal process group, for example, the material takes the form of a metal sheet; for plastic molding, in contrast, the material takes the form of an unstructured volume or mass of plastic pellets.

For process groups that use material stock, the cost model data specifies a list of available stocks for each type of material (see Working with Cost Model Data and Metadata). For a particular part, the end user can explicitly specify the stock to use; alternatively, the end user can let aPriori select the stock. For cases in which the end user has elected to let aPriori select the material stock, you can supply a material stock selection module to narrow down the available stocks to those that are feasible or desirable for the current part.

For example, for sheet metal parts, a stock selection module can check the geometry of the part, and eliminate stocks whose dimensions are exceeded by the blank dimensions.

When you navigate to the CSL modules for a node (see Navigating to the Data for a Given Node), if the node has a material stock selection module, the module’s Type Name field is set materialStockSelector and the label materialStockSelector appears next to the folder icon.

This section includes the following subsections:

Context of Evaluation

After the cost engine expands process templates, it considers each resulting routing in turn. For each routing, it evaluates the routing’s stock selector, and then for each resulting stock, it visits each process in the routing in order to perform process feasibility checks, machine selection, operation assignment, and operation and process costing (see Cost Engine Details).

So each stock selector is evaluated in the context of a particular process routing. But, for that routing, machines have not yet been selected, operations have not been assigned, and no processes or operations have been costed.

Finding or Designating a Routing’s Stock Selector

A process routing’s stock selection module is associated with one of the routing’s nodes. Typically, a routing’s stock selector is associated with the process called Material Stock. In some cases, to allow different routings to have different stock selectors, multiple nodes have stock selector modules, but only one is evaluated by the cost engine for a given routing.

The simplest way for a routing to designate the stock selector node is by the presence of the node attribute utilizationProcess, where the attribute has no value. If there is more than one node with this attribute (and they are all valueless), the cost engine treats the right-most active one as the stock selector node.

A routing can also designate the stock selector node by specifying the node’s name as the value of utilizationProcess for some other node in the routing. If there is more than one node with a value for this attribute, the left-most one specifies the name of the stock selector node.

For example, for the sheet metal process group, if a routing includes the branch node Prog Die, which has a node attribute utilizationProcess whose value is Progressive Die, the cost engine evaluates the stock selection module associated with Progressive Die (assuming no other node has a value for utilizationProcess).

See also Cost Engine Details.

Stock Selector Input

For process groups that use material stock, the complete list of available stocks (for the current user-selected material) is presented in aPriori ’s Material Selection dialog, when the Material Stock pane is expanded. When the cost engine evaluates a stock selection module, it puts into scope the CSL standard input stocks, and establishes its value as a collection that contains each of these available stocks.

Stock Selector Outputs

If the stock selection module establishes a collection of stocks as the value for the CSL output validMaterialStocks, the cost engine considers each stock in the collection.

If the stock selection module does not establish a non-null value for the CSL output validMaterialStocks, the cost engine considers only one, virtual stock, specified as follows:

  • For the Machining process group, virtual stock dimensions are determined by the values of other CSL outputs for the stock selection module, the dimensions of the current part, and plant variables, as follows:

    • Length:

      • CSL output virtualStockLength, if non-null.

      • Otherwise, the larger of the current part’s minStockLength and the value of the plant variable standardStockLength, if the plant variable is defined.

      • Otherwise, the larger of the current part’s minStockLength and 20 feet.

    • Width:

      • CSL output virtualStockWidth, if non-null.

      • Otherwise, the width of the current part’s cross-section.

    • Height:

      • CSL output virtualStockHeight, if non-null.

      • Otherwise, the height of the current part’s cross-section.

    • Inside diameter:

      • CSL output virtualStockInsideDiameter, if non-null.

      • Otherwise, the inside diameter of the current part’s cross-section.

    • Outside diameter:

      • CSL output virtualStockOutsideDiameter, if non-null.

      • Otherwise, the outside diameter of the current part’s cross-section.

    • Thickness:

      • CSL output virtualStockThickness, if non-null.

      • Otherwise, the thickness of the current part’s cross-section..

  • For the Sheet Metal process group, virtual stock dimensions are determined by the values of other CSL outputs for the stock selection module, the dimensions of the current part, and plant variables, as follows:

    • Length:

      • The larger of the blank’s length and the CSL output virtualStockLength, if non-null.

      • Otherwise, the larger of the blank’s length and the value of the plant variable standardStockLength, if the plant variable is defined.

      • Otherwise, the larger of the blank’s length and 8 feet.

    • Width:

      • The larger of the blank’s width and the CSL output virtualStockWidth, if non-null.

      • Otherwise, the larger of the blank’s width and the value of the plant variable standardStockWidth, if the plant variable is defined.

      • Otherwise, the larger of the blank’s width and 4 feet.

Example

In aPriori ’s starting point Digital Factories, the sheet metal process Material Stock uses a stock selection module to find stocks with a length, width, and thickness appropriate for the current part:

Copy
THICKNESS_SNAP = 0.05 // mm error between the actual measured sheet metal thickness and the closest actual stock size
 
validMaterialStocks = select from stocks as s where _
    equalsEps(s.thickness, part.thickness, THICKNESS_SNAP) and _
        ((part.blankBoxLength <= s.length and part.blankBoxWidth <= s.width) or _
            ((part.blankBoxLength <= s.width and part.blankBoxWidth <= s.length)))

 

This query uses the following simple identifiers:

  • validMaterialStocks is the module’s output.

  • stocks is the CSL standard input containing each initially available stock.

  • s is, in effect, bound to each element of stocks in turn.

  • part is the CSL standard input designating the current part.

  • THICKNESS_SNAP is a constant, the maximum allowable difference between stock and part thickness.

 

The query assigns to validMaterialStocks a collection that contains the elements of stock that meet both the following conditions:

  • The stock’s thickness is within THICKNESS_SNAP of the part’s thickness.

  • The part’s blank fits on the stock, that is one of the following is true:

    • The blank’s length and width  are less than the stock’s length and width

    • The blank’s length is less than the stock’s width and the blank’s width is less than the stock’s length.